#!/usr/bin/env node

const {Writable}=require('stream'),
  chalk=require('chalk');

  class GreenStream extends Writable{
    constructor(){
      super();
    }

    _write(chunk,encoding,callback){
      process.stdout.write(chalk.greenBright(chunk));//chunk?
      callback();//别忘
    } 
}
//pipe管道连接
var gs=new GreenStream();
process.stdin.pipe(gs);

